package com.moive.news.tqnewsapplication.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.moive.news.tqnewsapplication.R;
import com.moive.news.tqnewsapplication.base.Adapter.BaseListAdapter;
import com.moive.news.tqnewsapplication.entity.AttentBean;

import java.util.List;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * Created by Administrator on 2017/12/25.
 */

public class AttentAdapter extends BaseListAdapter<AttentBean.DataBean> {
    private Context context;

    public AttentAdapter(Context context) {
        this.context = context;
    }

    @Override
    protected View getItemView(int position, View convertView, ViewGroup parent, List<AttentBean.DataBean> item) {
        ViewHolder viewHeolder=null;
        if (viewHeolder==null){
            viewHeolder=new ViewHolder();
            convertView = LayoutInflater.from(context).inflate(R.layout.adapter_fenlei02, null);
            viewHeolder.fenlei02_img = convertView.findViewById(R.id.fenlei02_img);
            viewHeolder.fenlei02_name = convertView.findViewById(R.id.fenlei02_name);
            viewHeolder.fenlei02_time = convertView.findViewById(R.id.fenlei02_time);
            viewHeolder.fenlei02_guanzhu_number = convertView.findViewById(R.id.fenlei02_guanzhu_number);
            viewHeolder.fenlei02_guanzhu=convertView.findViewById(R.id.fenlei02_guanzhu);
            convertView.setTag(viewHeolder);
        }else {
            viewHeolder= (ViewHolder) convertView.getTag();
        }

        return convertView;
    }
    class ViewHolder{
        CircleImageView fenlei02_img;
        TextView fenlei02_name, fenlei02_time, fenlei02_guanzhu_number;
        ImageView fenlei02_guanzhu;
    }
}
